home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / roldx6.doc < prev    next >
Text File  |  1995-03-31  |  8KB  |  172 lines

  1. ROLDX - Rolodex program v2.0 
  2. From: Jim Weisbin <73457.3462@CompuServe.COM> 
  3. Newsgroups: comp.sources.hp48 
  4. Date: Sun, 27 Oct 1991 23:34:05 GMT 
  5.  
  6. Yet another rolodex program for the HP48. After sampling  
  7. the various rolodex-type programs out there, I decided I  
  8. needed to write my own. This one is written entirely in  
  9. user code, so it can be easily modified. It is not as fast  
  10. as some of the PDL and ML versions, but it mostly does what  
  11. I expect from a rolodex program where some of the others  
  12. fall short. PICT is not used, which greatly simplified the  
  13. programming effort. The database form is "free form" in the  
  14. sense that you can store anything you like on any line as  
  15. long as you have at least seven items in each list (only 7 
  16. will be displayed). The 48 can display 7 lines of text  
  17. quickly with a minimum of fuss and I find this to be  
  18. adequate room to store name, address, phone, fax, and email  
  19. data. 
  20.  
  21. The program is distributed as a directory. Press ROLDX to  
  22. start. Depending on the value of flag 34 (see below), you  
  23. will either see a screen with all 7 lines of the current  
  24. item, or a screen containing 7 items, each being one line  
  25. from each of 7 items starting from the current. You will be  
  26. presented with a menu as follows: 
  27.  
  28. FIND        FIND text prompted for. If one character only, 
  29.         only the 1st character of 1st or 2nd word (see 
  30.         flag 32 below) is checked for a match. If more 
  31.         than one character, a match is sought in any 
  32.         position. Only the line number set by the var 
  33.         rdLINE is searched. 
  34. EDIT        the usual - all 7 lines must be edited, RETURN  
  35.         leaves each unchanged. An empty string is ok. 
  36. ADD        add an item _after_ the current item. 
  37. DEL        delete the current item (you can't delete 1 of 
  38.         1 though). 
  39. ->STK    put the current item on the stack. 
  40. STK->    insert an item from the stack. (Must be a list with 
  41.         at least 7 items). 
  42.  
  43. In addition to the menu keys above, the following key- 
  44. presses are supported: 
  45.  
  46. right-arrow, down-arrow, NEXT            increment pointer 
  47. up-arrow, left arrow, PREV            decrement pointer 
  48. left-shift right-arrow & down-arrow     incr pointer by 7  
  49. left-shift left-arrow & up-arrow        decr pointer by 7 
  50. right-shift right-arrow & down-arrow    go to last 
  51. right-shift left-arrow & up-arrow        go to first (top) 
  52. ENTER                             enter STATUS mode 
  53.                                 (change settings) 
  54. right-shift OFF                    OFF (pause program) 
  55. shift-PRINT                         print current item 
  56.  
  57. There is no sorting provided, but you can use .->STK, STK->,  
  58. and DEL to move things around. (If you have Donnelly's Toolkit library, you can use LSORT - see below). The data format makes it fairly easy to transfer data to a PC and edit it there. 
  59.  
  60. The following global variables must be present in the  
  61. current directory, and are provided with the listing: 
  62.  
  63. rdNAME    a global containing another global which points  
  64.         to the roldx data list. For example, if the name  
  65.         of your data list is LIST1, then 'rdNAME' should 
  66.         contain the global 'LIST1', *not* the list  
  67.         itself! The format of the data list is a list of 
  68.         lists, each inner list containing at least 7 items,         which can be empty strings, but must be present. The         data format is the same as the iNB "Notebook" program         which was posted to the net sometime ago (my 
  69.         complements to Poul-Henning Kamp). The program will 
  70.         not create a new list if one is not present, so you 
  71.         should modify the one I have provided, called LIST1. 
  72.         The data list must be in the Roldx directory!!! 
  73. rdSIZ    the number of entries (lists) in the data list. 
  74. rdPOS    number of the current item to display. 
  75. rdLINE    number of the line to search on, and the number of 
  76.         the line which gets displayed when displaying only 
  77.         the headings (flag 34 set). 
  78. rdTXT    the last text sought by the FIND command (can be 
  79.         a null string).  
  80.  
  81. The settings of user flags 32-35 are as follows (use the  
  82. ENTER key to enter status mode and change the settings): 
  83.  
  84. Flag 32    if clear, and rdTEXT is only one character,  
  85.         (as set by the FIND command), the program will 
  86.         attempt to match the first character of the 1st 
  87.         word of the line to search on (rdLINE). In other 
  88.         words, clear flag 32 if you put surnames first. If 
  89.         you put surnames last, then set flag 32, and  
  90.         the program will attempt to match the 1st  
  91.         character of the 2nd word of the line to search. 
  92.         The words are assumed to be separated by a 
  93.         space. If no spaces are present, then the action 
  94.         is the same as if flag 32 is clear. Note that, if 
  95.         flag 32 is set, and there is either a trailing space 
  96.         or more than one space after the first word (and  
  97.         no other words), the program will attempt to match 
  98.         a space. In other words, avoid trailing spaces!!! 
  99. Flag 33    if clear, the FIND command searches from the  
  100.         current position in the list, if set, it  
  101.         searches from the beginning, which can be very  
  102.         slow for large databases. Note that only the  
  103.         line number in rdLINE is searched (searching 
  104.         all lines would be too slow - perhaps a future 
  105.         PDL version will overcome this). 
  106. Flag 34     if clear, display all 7 lines of each item, if  
  107.         set, display only one line of each item, for a 
  108.         total of seven items on each screen. With flag 
  109.         34 set, the line diplayed for each item is the 
  110.         value of rdLINE. When flag 34 is set, using 
  111.         left-shift-arrows will scroll ahead or back by 
  112.         exactly 7 items (one full screen holds 7 lines). 
  113. Flag 35     a temporary flag used by FIND to signal a match. 
  114.  
  115. In STATUS mode, there is a HELP key. The program HELP will 
  116. also work when outside of the ROLDX program.  
  117.  
  118. Miscellaneous notes: 
  119.  
  120. Some of the routines are appropriate for general use. These 
  121. are as follows: 
  122.  
  123. bell        an error bell - edit to anything you want, as 
  124.         long as it can be evaluated. 
  125. Ltrim    trim leading spaces from a string. Similar to 
  126.         Donnelly's LTRIM, but doesn't remove tabs. 
  127.         Can be replaced by Donnelly's LTRIM for more  
  128.         speed. 
  129. split    split the <list in level 2> at the item  
  130.         <number in level 1>. Equivalent to Donnely's 
  131.         SPLIT SWAP. 
  132. LDEL        delete the item <number in level 1> from the  
  133.         <list in level 2> resulting in a new list minus 
  134.         that item. 
  135. UPcase    change case of characters between "a" and "z" to 
  136.         uppercase. Replacing this with Donnelly's UCASE 
  137.         will speed up FIND by at least 20%. Or, use the 
  138.         following ML routine, which was posted to the net 
  139.         (my apologies to the author, whose name I've lost): 
  140.  
  141. %%HP: T(3)A(D)F(.); 
  142. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8AAE4D71643106AE514A9EC0331B79EAD131FD9EAE1317F9625131FF962C0310EA6A148161CF8AF2C8F2D760142164808CB2130B2130BDE1" 
  143.  
  144. (run the above through ASC->). 
  145.  
  146. As noted above, if you want to sort the data list, you can use 
  147. Donnelly's LSORT. Put the list on the stack and press OBJ->,  
  148. then enter the number of the line you want to sort on (usually 
  149. will be 1), then press LSORT from the TLLIB menu. Note that 
  150. this will sort on the first letter(s) of each line so it is not 
  151. really appropriate if you put surnames last (in other words, if 
  152. you put surnames last, you will be sorting on first names). 
  153.  
  154. Some may ask why I put the  program's dynamic parameters (like 
  155. rdPOS, for example) in separate global variables, rather than 
  156. in a parameter list. The answer is SPEED! The 48 can evaluate a 
  157. global variable at least twice as fast as GETting a list item, 
  158. and this can make a big difference to a program written in RPL. 
  159. A future version of this program might be written in PDL, but 
  160. who knows? 
  161.  
  162. I personally don't see the usefulness of compiling this  
  163. into a library, but it should be do-able, providing the  
  164. variables rdXXX mentioned above are in the $VAR list used 
  165. by USRLIB. The program is free and distributed as-is: use  
  166. at your own risk. There are NO sysevals or ML's to blow up  
  167. your machine, but I make no guarantees of any kind. 
  168. As distributed, the directory takes 4924.5 bytes (chksum #9582h). 
  169.  
  170. James Weisbin 73457.3462@compuserve.com 
  171.  
  172.